package com.salelogistics.system.api;

import com.salelogistics.common.core.constant.ServiceNameConstants;
import com.salelogistics.common.core.web.domain.AjaxResult;
import com.salelogistics.common.core.web.page.TableDataInfo;
import com.salelogistics.system.api.domain.BasMaterial;
import com.salelogistics.system.api.factory.RemoteBasMaterialFallBackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(contextId = "remoteBasMaterialService",
        value = ServiceNameConstants.BASIC_SERVICE,
        fallbackFactory = RemoteBasMaterialFallBackFactory.class)
public interface RemoteBasMaterialService {
    /**
     * 查询材料
     *
     * @param materialId 材料主键
     * @return 材料
     */
    @GetMapping("material/{materialId}")
    public AjaxResult selectBasMaterialByMaterialId(@PathVariable("materialId") Long materialId);

    /**
     * 查询材料列表
     *
     * @param basMaterial 材料
     * @return 材料集合
     */
    @GetMapping("material/listVo")
    public TableDataInfo selectBasMaterialList(@RequestParam("basMaterial") BasMaterial basMaterial);
}
